var __extends =
    (this && this.__extends) ||
    (function () {
      var t = function (n, o) {
        return (t =
          Object.setPrototypeOf ||
          ({ __proto__: [] } instanceof Array &&
            function (t, n) {
              t.__proto__ = n;
            }) ||
          function (t, n) {
            for (var o in n)
              Object.prototype.hasOwnProperty.call(n, o) && (t[o] = n[o]);
          })(n, o);
      };
      return function (n, o) {
        function e() {
          this.constructor = n;
        }
        if ("function" != typeof o && null !== o)
          throw new TypeError(
            "Class extends value " + String(o) + " is not a constructor or null"
          );
        t(n, o),
          (n.prototype =
            null === o
              ? Object.create(o)
              : ((e.prototype = o.prototype), new e()));
      };
    })(),
  AXTaoYuanLihunDialog = (function (t) {
    function n() {
      var n = t.call(this) || this;
      return (
        n.btn_consult.on(Laya.Event.CLICK, n, n.onConsultDidClick),
        n.btn_force.on(Laya.Event.CLICK, n, n.onForceDidClick),
        WebSocketService.addListener({
          caller: n,
          code: 1372,
          method: n.onLoadData,
        }),
        Laya.stage.on("AXTaoYuanLihunDialog", n, n.eventHandler),
        n
      );
    }
    return (
      __extends(n, t),
      (n.showDialog = function (t) {
        null == this.instance && (this.instance = new n()),
          (this.instance.type = 0),
          (this.instance.info = t),
          (this.instance.label_name.text = t.name),
          this.instance.popup();
      }),
      (n.prototype.onConsultDidClick = function () {
        (this.type = 1),
          AXTaoYuanSureDialog.showDialog({
            title: "永结同心",
            msg: "您真的要和伴侣协议离婚吗？",
            from: "AXTaoYuanLihunDialog",
            code: "xin",
          });
      }),
      (n.prototype.onForceDidClick = function () {
        (this.type = 2),
          AXTaoYuanSureDialog.showDialog({
            title: "永结同心",
            msg: "您真的要和伴侣强制离婚吗？",
            from: "AXTaoYuanLihunDialog",
            code: "xin",
          });
      }),
      (n.prototype.eventHandler = function (t) {
        t &&
          (1 == this.type && WebSocketService.send({ c: 1372 }),
          2 == this.type && WebSocketService.send({ c: 1373 }));
      }),
      (n.prototype.onLoadData = function (t) {
        ToastView.toastView(t.msg), 0 != t.code || this.close();
      }),
      n
    );
  })(ui.SquareController.AXTaoYuanLihunDialogUI);
